﻿using System;
using System.Collections.Generic;
using WinHBM.Core.DB;
using WinHBM.Utils;

namespace WinHBM.Core.module
{
    class Baby
    {

        private static string TABLE_FLOWER_LOG = "flowerLog";
        private static string TABLE_BABY = "babyInfo";

        public String id;
        public String name;
        public String avatar;
        public String red;
        public String class_id;

        public static bool hasBaby(int studentId)
        {
            Dictionary<string, string> dic_condition = UtilDict.make<string, string>("babyId", studentId + "");
            List<Dictionary<string, string>> sqllist = SQLiteHelper.Instance.find(TABLE_BABY, dic_condition);
            if (sqllist.Count > 0)
            {
                return true;
            }
            return false;
        }

        public static int Count()
        {
            Dictionary<string, string> dic_condition = UtilDict.make<string, string>();
            List<Dictionary<string, string>> sqllist = SQLiteHelper.Instance.findAll(TABLE_BABY);
            return sqllist.Count;
        }
    }
}
